Class Nur.MNISV3.Service.Notification Extends %Persistent
{

/// Creator:      fengliang
/// CreatDate:    2020-07-17
/// Description:  获取通知列表
/// Input wardId,userId
/// w ##class(Nur.MNISV3.Service.Notification).GetNotifyListNew("3","18885","8")
ClassMethod GetNotifyListNew(wardId As %String, userId As %String, locId As %String = "")
{
	s $zt="errorgetNotifyListNew"
	s ^MML("GetNotifyListNew")=$lb(wardId , userId , locId)
	s msg="成功",msgcode="999999",status="0" //定义初始值
	s newOrdPatList=##class(%ListOfDataTypes).%New()
	s stopOrdPatList=##class(%ListOfDataTypes).%New()
	s abnormalOrdPatList=##class(%ListOfDataTypes).%New()
	s rs=##class(%ResultSet).%New("Nur.MNISV3.Service.Patient:GetPatList")
	d rs.Execute(wardId)
	while(rs.Next()){
		s episodeId=rs.GetDataByName("episodeId")
		s inBedAll=rs.GetDataByName("inBedAll")
		continue:inBedAll'=1
		//start 先过滤管床 
		s bedSub=$p($g(^PAADM(episodeId)),"^",73)
		continue:bedSub=""
		s papmiId=+$g(^PAADM(+episodeId))
		s patName=$p($g(^PAPER(papmiId,"ALL")),"^",1)
		s regNo=$p($g(^PAPER(papmiId,"PAT",1)),"^",1)
		s patSex=$p($g(^CT("SEX",$p($g(^PAPER(papmiId,"ALL")),"^",7))),"^",2)
		s curWardId=$P(bedSub,"||",1)
		s curBedSub=$P(bedSub,"||",2)
		s bedCode=$p($g(^PAWARD(curWardId,"BED",curBedSub)),"^",1)
		s selectedBed=0
		i $D(^DHCNurManagedBedsSet("PDASet",userId,wardId,bedSub)) s selectedBed=^DHCNurManagedBedsSet("PDASet",userId,wardId,bedSub)
		s motherAdm=$p($g(^PAADM(episodeId)),"^",75)
		i motherAdm'=""  s mumBed=$p($g(^PAADM(motherAdm)),"^",73)
		e  s mumBed=""
		i (mumBed'="")  d
		.i $D(^DHCNurManagedBedsSet("PDASet",userId,wardId,mumBed)) s selectedBed=^DHCNurManagedBedsSet("PDASet",userId,wardId,mumBed)
		continue:selectedBed=0
		//end
		;s ^MML("episodeId",episodeId)=episodeId
		//再去查图标
		;s ifNewOrdFlag=1 //##class(web.DHCSETIMAGE).IfNewOrdItem($g(episodeId),1,1)
    	;s ifNewLsOrdFlag=##class(web.DHCSETIMAGE).IfNewOrdItem($g(episodeId),2,1)
    	;s ifNewLongOrdFlag=##class(web.DHCSETIMAGE).IfNewOrdItem($g(episodeId),3,1)
    	s ifNewLsOrdFlag=##class(web.DHCSETIMAGE).IfNewOrder($g(episodeId),"T")
    	s ifNewLongOrdFlag=##class(web.DHCSETIMAGE).IfNewOrder($g(episodeId),"L")
    	s ifStopOrdFlag=##class(web.DHCSETIMAGE).IfStopOrd($g(episodeId)) 
   		s newOrd=0,Abnormal=0
    	;i (ifNewOrdFlag'=0)||(ifNewLsOrdFlag'=0)||(ifNewLongOrdFlag'=0) s newOrd=1
    	i (ifNewLsOrdFlag'=0)||(ifNewLongOrdFlag'=0) s newOrd=1
	    s AbnormalFlag=##Class(web.DHCAntService).GetReportWarn(episodeId)
	    i $G(^DHCNurManagedBedsSet("PDAReadMsg",episodeId,+$H))=1 s AbnormalFlag=0
	    i AbnormalFlag=1 s Abnormal=1
    	
    	//测试
    	;i "3473^4114^4113^3643"[episodeId s newOrd=1
		;i "3473^4114"[episodeId s ifStopOrdFlag=1
		;i bedCode["02" s newOrd=1
		
		s notifyInfo=##class(%ArrayOfDataTypes).%New()
		d notifyInfo.SetAt(bedCode_"床","bedCode")
		d notifyInfo.SetAt(patName,"patName")
		d notifyInfo.SetAt(patSex,"sex")
		d notifyInfo.SetAt(episodeId,"episodeId")
		d notifyInfo.SetAt(regNo,"regNo")
		d notifyInfo.SetAt(+bedCode,"index")
		d notifyInfo.SetAt(bedCode_"床"_patName,"patInfo")
		d notifyInfo.SetAt("","msgDesc")
		i ifStopOrdFlag=1 d stopOrdPatList.Insert(notifyInfo)
		i newOrd=1 d newOrdPatList.Insert(notifyInfo)
		i Abnormal d abnormalOrdPatList.Insert(notifyInfo)
	}
	s skinTimeList=..GetSkinTimeList(locId)
	s consultList=..GetConultList(locId)
	s msgList=##class(%ListOfDataTypes).%New()
	d ..GetMsgSetList(locId,.msgSetList)
	;zw msgSetList
	s msgSort=""
	f
	{
		s msgSort=$o(msgSetList(msgSort))
		q:msgSort=""
		s msgId=""
		f
		{
			s msgId=$o(msgSetList(msgSort,msgId))
			q:msgId=""
			s msgSetData=msgSetList(msgSort,msgId)
			s msgName=$p(msgSetData,"^",1)
			s msgCode=$p(msgSetData,"^",2)
			s msgData=##class(%ArrayOfDataTypes).%New()
			d msgData.SetAt(msgName,"msgName")
			d msgData.SetAt(msgCode,"msgCode")
			//提示方式: ""不计入提醒； 1通知栏 ；2弹窗
			s notifyType=""
			//显示类型 list grid
			s listType="list"
	
			//医嘱执行,分隔regNo参数 
			s toModule="com.dhcc.nursepro.workarea.orderexecute.OrderExecuteFragment,regNo,sheetCode=CQZSD"
			//床位图
			s toModule="com.dhcc.nursepro.workarea.bedmap.BedMapFragment,regNo"
			//入院分床
			s toModule="com.dhcc.nursepro.workarea.allotbed.AllotBedFragment,regNo"
			//事件登记
			s toModule="com.dhcc.nursepro.workarea.patevents.PatEventsFragment,regNo"
			//巡视
			s toModule="com.dhcc.nursepro.workarea.nurtour.NurTourFragment,regNo"
			//护理病历
			s toModule="com.dhcc.nursepro.workarea.nurrecordnew.PatNurRecordFragment,regNo"
			//医嘱单
			;s toModule="com.dhcc.nursepro.workarea.docorderlist.DocOrderListFragment,episodeId"
			//医嘱查询
			s toModuleSearch="com.dhcc.nursepro.workarea.ordersearch.OrderSearchFragment,sheetCode=CQZSD"
			//体征录入
			s toModuleVitalsign="com.dhcc.nursepro.workarea.vitalsign.VitalSignRecordFragment,time=08:00:00,date=2022-09-07,regNo"
			
			//输血查询   
			s toModuleVitalsign="com.dhcc.module.nurse.bloodtransfusion.BloodTransSearchFragment,regNo"
			//健康宣教
			s toModuleVitalsign="com.dhcc.module.nurse.education.HealthEduFragment,regNo"
			//护理计划
			s toModuleVitalsign="com.dhcc.module.nurse.nurplan.NurPlanFragment,regNo"
			//血糖录入
			s toModuleVitalsign="com.dhcc.module.nurse.bloodsugar.BloodSugarRecordFragment,episodeId,patInfo"
			//默认是展开: ""展开 1关闭
			s closeFlag=""
			s msgSubList=newOrdPatList
			i msgCode="NewOrd" {
				s msgSubList=newOrdPatList
				s notifyType=1
				s listType="grid"
				s toModule=toModuleVitalsign  //体征录入
			}
			i msgCode="StopOrd" {
				 s msgSubList=stopOrdPatList
				 s notifyType=1
				 s toModule=toModuleSearch  //医嘱查询
			}
			i msgCode="Abnormal" {
				s msgSubList=abnormalOrdPatList
				s notifyType=1
			}
			i msgCode="Skin" {
				s msgSubList=skinTimeList
				s notifyType=2
			}
	
			i msgCode="Consult" {
				s msgSubList=consultList
				s notifyType=1
				s closeFlag="1"
			}
			s toModule=$p(msgSetData,"^",6)
			s notifyType=$p(msgSetData,"^",7)
			s listType=$p(msgSetData,"^",8)
			s closeFlag=$p(msgSetData,"^",9)
			s msgNum=msgSubList.Count()
			d msgData.SetAt(msgNum,"msgNum")
			d msgData.SetAt(msgNum,"msgType")
			d msgData.SetAt($g(closeFlag),"closeFlag") //是否展开
			d msgData.SetAt($g(listType),"listType") //显示类型 list grid
			d msgData.SetAt($g(notifyType),"notifyType") //提示方式: ""不计入提醒； 1通知栏 ；2弹窗
			d msgData.SetAt($g(toModule),"toModule") //跳转模块
			d msgData.SetAt(msgSubList,"msgSubList")
			d msgList.Insert(msgData)
		}
	}
	
	s json=##class(%ArrayOfDataTypes).%New()
	d json.SetAt($g(msg),"msg")
	d json.SetAt($g(msgcode),"msgcode")
	d json.SetAt($g(status),"status")
	//提醒方式获取
	d json.SetAt(1,"soundFlag")
	d json.SetAt(1,"vibrateFlag")
	
	s generalSetting=##class(Nur.MNISV3.Service.Config).GetGeneralSetting("",locId)
	s startDate=generalSetting.GetAt("SchStartDate"),startTime=generalSetting.GetAt("SchStartTime")
	s endDate=generalSetting.GetAt("SchEndDate"),endTime=generalSetting.GetAt("SchEndTime")
	s stdatetime=$zd(+$h+startDate,3)_" "_startTime
    s enddatetime=$zd(+$h+endDate,3)_" "_endTime
	s curDateTime=$zd(+$h,3)_" "_$zt($p($h,",",2))	
	d json.SetAt($g(stdatetime),"schStDateTime")  
	d json.SetAt($g(enddatetime),"schEnDateTime")
	d json.SetAt($g(curDateTime),"curDateTime")  
	d json.SetAt($g(msgList),"msgList") 
	q ##class(Nur.MNISV3.Common.JSON).Encode(json)
errorgetNotifyListNew
	s msg=$ze
	q ##class(Nur.MNISV3.Common.Utils).ReturnMsgJson(msg,"false","-1")
}

/// Creator:      fengliang
/// CreatDate:    2020-07-17
/// Description:  通过科室取消息配置
/// Method		  w ##class(Nur.MNISV4.Service.Notification).GetMsgSetList(149)
ClassMethod GetMsgSetList(locId, msgSetList) As %String
{
	k msgID
	s id=""
	f  s id=$o(^CT.NUR.MNIS.MessageD(id)) q:id=""  d
	.s msgData=^CT.NUR.MNIS.MessageD(id)
	.s msgcode=$listget(msgData,3)
	.s sort=$listget(msgData,4)
	.s canFlag=$listget(msgData,5)
	.q:canFlag="N"
	.//默认显示标准数据，如果按科室设置之后显示科室配置
	.//s msgLocId=$o(^CT.NUR.MNIS.MsgByLocI("locCodeIndex"," "_$ZCVT(locId,"U")," "_$ZCVT(msgcode,"U"),""))
	.s msgLocId=##class(Nur.MNISV3.Service.Config).GetMessageByLocID("",locId,"",msgcode)
	.i msgLocId'="" d
	..s msgLocData=$g(^CF.NUR.MNIS.MsgByLocD(msgLocId))
	..q:msgLocData=""
	..s sort=$listget(msgLocData,4)
	.i sort="" s sort=999999
	.s msgID(sort,id)=1

	s sort=""
	f  s sort=$o(msgID(sort)) q:sort=""  d
	.s subId="" ;w sort,!
	.f  s subId=$o(msgID(sort,subId)) q:subId=""  d
	..s msgData=$g(^CT.NUR.MNIS.MessageD(subId))
	..s msgName=$listget(msgData,2)
	..s msgcode=$listget(msgData,3)
	..s msgSort=$listget(msgData,4)
	..s msgShowFlag="Y"
	..//默认显示标准数据，如果按科室设置之后显示科室配置
	..s msgLocId=##class(Nur.MNISV3.Service.Config).GetMessageByLocID("",locId,"",msgcode)
	..s msgRemindFlag="",msgRemindSoundFlag="",msgRemindVibrateFlag=""
	..s toModule="",sheetCode="",notifyType="",listType="",closeFlag=""
	..i msgLocId'="" d
	...s msgLocData=$g(^CF.NUR.MNIS.MsgByLocD(msgLocId))
	...q:msgLocData=""
	...s msgSort=$listget(msgLocData,4)
	...s msgShowFlag=$listget(msgLocData,5)
	...s msgRemindFlag=$listget(msgLocData,6)
	...s msgRemindSoundFlag=$listget(msgLocData,7)
	...s msgRemindVibrateFlag=$listget(msgLocData,8)
	...s toModule=$lg(msgLocData,10)
	...s sheetCode=$lg(msgLocData,11)
	...s notifyType=$lg(msgLocData,12)
	...s listType=$lg(msgLocData,13)
	...s closeFlag=$lg(msgLocData,14)
	..i (msgShowFlag="") s msgShowFlag="Y"
	..q:msgShowFlag'="Y"
	..i (toModule["com.dhcc.nursepro.workarea.orderexecute.OrderExecuteFragment") d
	...s toModule=toModule_",regNo,sheetCode="_sheetCode
	..e  i (toModule["com.dhcc.nursepro.workarea.ordersearch.OrderSearchFragment") d
	...s toModule=toModule_",sheetCode="_sheetCode
	..e  i (toModule["com.dhcc.module.nurse.bloodtransfusion.BloodTransSearchFragment") d
	...s toModule=toModule_",regNo"
	..e  i (toModule["com.dhcc.nursepro.workarea.nurtour.NurTourFragment") d
	...s toModule=toModule_",regNo"
	..e  i (toModule["com.dhcc.nursepro.workarea.nurrecordnew.PatNurRecordFragment") d
	...s toModule=toModule_",regNo"
	..e  i (toModule["com.dhcc.nursepro.workarea.vitalsign.VitalSignRecordFragment") d
	...s dateTime=##class(Nur.MNIS.Service.Temperature).GetDateTime(locId,"")
	...s date=$p(dateTime,"^",1),time=$p(dateTime,"^",2)
	...s toModule=toModule_",time="_time_",date="_date_",regNo"
	..e  i (toModule["com.dhcc.module.nurse.bloodsugar.BloodSugarRecordFragment") d
	...s toModule=toModule_",episodeId,patInfo"
	
	..s closeFlag=$s(closeFlag="Y":0,closeFlag="N":1,1:"")
	..s msgSetList(sort,subId)=msgName_"^"_msgcode_"^"_msgRemindFlag_"^"_msgRemindSoundFlag_"^"_msgRemindVibrateFlag_"^"_toModule_"^"_notifyType_"^"_listType_"^"_closeFlag
	q 0
}

/// Creator:      fengliang
/// CreatDate:    2022-09-05
/// Description:  获取皮试列表
/// Method		  w ##class(Nur.MNISV4.Service.Notification).GetSkinTimeList(149)
ClassMethod GetSkinTimeList(locId) As %String
{
	s skinTimeList=##class(%ListOfDataTypes).%New()   //皮试时间列表
	;s StartDate=+$h
	f StartDate=+$h-1:1:+$h {
	s curTime="" 
	f  
	{
		s curTime=$O(^User.DHCNurSkinTestListI("StartDateTime",StartDate,curTime)) 
		q:curTime=""
		s curId="" 
		f
		{  
			s curId=$O(^User.DHCNurSkinTestListI("StartDateTime",StartDate,curTime,curId)) 
			q:curId=""
			s testLocDr=$ListGet(^User.DHCNurSkinTestListD(curId),13)
		    continue:testLocDr'=locId
			s testDate=$ListGet(^User.DHCNurSkinTestListD(curId),4)
			;continue:testDate'="" //已做过皮试  
			s testAdmDr=$ListGet(^User.DHCNurSkinTestListD(curId),2)
			;w "curId=",curId,"-",testAdmDr,!
			continue:testAdmDr=""  
			s papmiId=$P($G(^PAADM(testAdmDr)),"^",1)
			;w testAdmDr,"-",papmiId,!
			continue:papmiId=""
			s testTime=$ListGet(^User.DHCNurSkinTestListD(curId),7)
			i testTime'="" s testTime=$ZT(testTime)
			s testStartDate=$ListGet(^User.DHCNurSkinTestListD(curId),5)
			s testStartTime=$ListGet(^User.DHCNurSkinTestListD(curId),6)
			s observeTime=$ListGet(^User.DHCNurSkinTestListD(curId),12)
			i observeTime'="" d
			.i observeTime["分钟" s observeTime=+observeTime*60
			.i observeTime["小时" s observeTime=+observeTime*3600
			s toObserveTime=""
			i testDate="" d
			.s intervalTime=(+$h-testStartDate)*86400+($P($h,",",2)-testStartTime)
			.i observeTime>=intervalTime d
			..s toObserveTime=observeTime-intervalTime
			i testStartTime'="" s testStartTime=$ZT(testStartTime)	
			i testStartDate'="" s testStartDate=$Zd(testStartDate,3)	
			s ordId=$ListGet(^User.DHCNurSkinTestListD(curId),11)
  			s skintest=$p($g(^OEORD($p(ordId,"||",1),"I",$p(ordId,"||",2),5)),"^",2)
    		s abnorm=$p($g(^OEORD($p(ordId,"||",1),"I",$p(ordId,"||",2),11)),"^",3)
    		i skintest="Y" d
    		.s skinResutl=$s(abnorm="Y":"+",abnorm="N":"-",1:"")
    		s oew=+ordId,chl=$p(ordId,"||",2),sub=$p(ordId,"||",3)
			//查所有子医嘱是否已置结果
  			i skintest'="Y"{
			    s child=0  
			    f 
			    {
			        s child=$O(^OEORDi(0,"OEORI",oew,oew_"||"_chl,child))
			        q:child=""
			        continue:child=chl 
			        s arcicOrderType=##Class(web.DHCCLCom).GetOrdSubCatType(oew_"||"_child)
			        continue:arcicOrderType'="R"    
			        s skintest=$p($g(^OEORD(oew,"I",child,5)),"^",2)
			        i skintest="Y" {
				        s abnorm=$p($g(^OEORD(oew,"I",child,11)),"^",3)
				        s skinResutl=$s(abnorm="Y":"+",abnorm="N":"-",1:"")
			        }
			   	 }
	  			
	  		}
    		i (sub="") s sub=+$o(^OEORD(oew,"I",chl,"X",0))
    		s execStatusId=$p($g(^OEORD(oew,"I",chl,"X",sub)),"^",16)
    		s execStatCode=$s(execStatusId'="":$p($g(^OEC("STAT",execStatusId)),"^",1),1:"")
    		continue:(skintest="Y")&&(abnorm'="") // EH 已置
    		continue:(execStatCode="D")||(execStatCode="C") // EH 已停

			s mainOrdId=$p($g(^OEORD($p(ordId,"||",1),"I",$p(ordId,"||",2),11)),"^",39)
			i mainOrdId="" s mainOrdId=ordId
    		s oeoreGroup=##class(%ListOfDataTypes).%New()  //成组信息
    		d getOrdInfoList		
    		s patName=$p($g(^PAPER(papmiId,"ALL")),"^",1)
    		s patSex=$p($g(^CT("SEX",$p($g(^PAPER(papmiId,"ALL")),"^",7))),"^",2)
    		s regNo=$P($G(^PAPER(papmiId,"PAT",1)),"^",2)	
    		s bedCode=##class(Nur.CommonInterface.Patient).getBedCode(testAdmDr)
    		//皮试人 和 皮试核对人
    		s dhcoriId=$o(^DHCORDItem(0,$p(ordId,"||",1)_"||"_$p(ordId,"||",2),"")) 	
    		i dhcoriId'="" d
            .s skinTestCtcpId=$p(^DHCORDItem(dhcoriId),"^",2)
            .i skinTestCtcpId="" q
            .s skinTestCtcpDesc=$p($g(^CTPCP(skinTestCtcpId,1)),"^",2)
            .s skinTestDate=$p(^DHCORDItem(dhcoriId),"^",3)
            .s skinTestTime=$p(^DHCORDItem(dhcoriId),"^",4)
            .s skinTestDateTime=$zd(skinTestDate,3)_" "_$zt(skinTestTime,2)
            s dhcoriId=$o(^DHCORDItem(0,$p(ordId,"||",1)_"||"_$p(ordId,"||",2)_"||"_1,"")) 	
    		i dhcoriId'=""  d 
    		.s skinTestAuditCtcpId=$p(^DHCORDItem(dhcoriId),"^",13)
            .i skinTestAuditCtcpId="" q
            .s skinTestAuditCtcpDesc=$p($g(^CTPCP(skinTestCtcpId,1)),"^",2)
            .s skinTestAuditDate=$p(^DHCORDItem(dhcoriId),"^",14)
            .s skinTestAuditTime=$p(^DHCORDItem(dhcoriId),"^",15)
            .s skinTestAuditDateTime=$zd(skinTestAuditDate,3)_" "_$zt(skinTestAuditTime,2)
            .s skinTestAuditCtcpDesc=$p($g(^CTPCP(skinTestAuditCtcpId,1)),"^",2)
    		 	
    		 				
			s skinData=##class(%ArrayOfDataTypes).%New()
			d skinData.SetAt($g(bedCode),"bedCode")
			d skinData.SetAt($g(patName),"patName")
			d skinData.SetAt($g(patSex),"sex")
			d skinData.SetAt($g(testAdmDr),"episodeId")
			d skinData.SetAt($g(regNo),"regNo")
			s txt="皮试阴性" //测试测试测试测测测试测试测"_"<font color='red'>" _txt_ "</font>
			d skinData.SetAt("","msgDesc")
			d skinData.SetAt($g(toObserveTime),"overTime")
			d skinData.SetAt($g(testStartTime),"testStartTime")
			d skinData.SetAt($g(testStartDate),"testStartDate")
			d skinData.SetAt($g(observeTime),"observeTime")	
			d skinData.SetAt($g(mainOrdId),"oeoreId")	
			d skinData.SetAt($g(oeoreGroup),"oeoreGroup")
			d skinData.SetAt($g(skinResutl),"skinResutl")
			d skinData.SetAt($g(skinTestCtcpDesc),"skinTestCtcpDesc")
			d skinData.SetAt($g(skinTestDateTime),"skinTestDateTime")
			d skinData.SetAt($g(skinTestAuditCtcpDesc),"skinTestAuditCtcpDesc")
			d skinData.SetAt($g(skinTestAuditDateTime),"skinTestAuditDateTime")
			d skinTimeList.Insert(skinData)	
			s skinFlag=1
		}
	}
	}
	q skinTimeList
getOrdInfoList
	//获取成组医嘱信息
	s oeordId=$p(mainOrdId,"||",1)
	s oeoriSub=$p(mainOrdId,"||",2)
	s oeoreData=##class(%ArrayOfDataTypes).%New()  //成组中每条执行记录的信息
	s oeordIdInit=oeordId,oeoriSubInit=oeoriSub
	d initOeoreInfo
	d oeoreGroup.Insert(oeoreData)
	s child=0  
	f 
	{
		s child=$O(^OEORDi(0,"OEORI",oeordId,oeordId_"||"_oeoriSub,child))
		q:child=""
		continue:child=oeoriSub	
		s arcicOrderType=##Class(web.DHCCLCom).GetOrdSubCatType(oeordId_"||"_child)
		continue:arcicOrderType'="R"	
		s oeoreData=##class(%ArrayOfDataTypes).%New()  //成组中每条执行记录的信息
		s oeordIdInit=oeordId,oeoriSubInit=child
		d initOeoreInfo
		d oeoreGroup.Insert(oeoreData)
		
	}
	q
initOeoreInfo
     //医嘱名称
     s arcimDr=$p($g(^OEORD(oeordIdInit,"I",oeoriSubInit,1)),"^",2) 
	 s arcimDesc=$P($G(^ARCIM(+arcimDr,$p(arcimDr,"||",2),1)),"^",2)
	 //剂量
	 s doseQty=$p($g(^OEORD(oeordIdInit,"I",oeoriSubInit,2)),"^",1)
     i doseQty'="" s unitUomId=$p($g(^OEORD(oeordIdInit,"I",oeoriSubInit,2)),"^",3)
     e  s unitUomId=""
     i $g(unitUomId)'="" s unitDesc=$p($g(^CT("UOM",unitUomId)),"^",2)
     s dose=$g(doseQty)_" "_$g(unitDesc)
     s doseQtyUnit=$g(doseQty)_" "_$g(unitDesc)	
     //总量
     s phOrdQtyUnit=##class(Nur.OrderStaticInfo).getPhOrdQtyUnit(oeordIdInit,oeoriSubInit)
     i oeoriSubInit=$p(ordId,"||",2) s arcimDesc=$g(arcimDesc)_"("_$g(skinResutl)_")"
	 d oeoreData.SetAt($g(arcimDesc),"ArcimDesc")
	 d oeoreData.SetAt($g(doseQtyUnit),"DoseQtyUnit")
	 d oeoreData.SetAt($g(phOrdQtyUnit),"PhOrdQtyUnit")
	 q
}

ClassMethod GetConultList(locId) As %String
{
	s ConPatList=##class(%ListOfDataTypes).%New()
	s wardId=$o(^PAWARD(0,"WARD_LocationDR",locId,"")) 
	s rs=##class(%ResultSet).%New("Nur.MNIS.Service.Consultation:GetListConsult")
	d rs.Execute(wardId)
	while(rs.Next())
    {
		
		s NotifyInfo=##class(%ArrayOfDataTypes).%New()
		s bedCode=rs.GetDataByName("PatBedCode")
		s patName=rs.GetDataByName("PatName")
		s sex=rs.GetDataByName("Sex")
		s:sex="男" sex="M"
	    s:sex="女" sex="F"
		s EpisodeID=rs.GetDataByName("EpisodeID")
		s PatRegNo=rs.GetDataByName("PatRegNo")
		s conDocdesc=rs.GetDataByName("conDocdesc")
		s patLoc=rs.GetDataByName("csLocDocStr")
		d NotifyInfo.SetAt(bedCode,"bedCode")
		d NotifyInfo.SetAt(patName,"patName")
		d NotifyInfo.SetAt(sex,"sex")
		d NotifyInfo.SetAt(EpisodeID,"episodeId")
		d NotifyInfo.SetAt(PatRegNo,"regNo")
		d NotifyInfo.SetAt(conDocdesc,"conDocdesc")
		d NotifyInfo.SetAt(patLoc,"patLoc")
		d ConPatList.Insert(NotifyInfo)
		s conPatFlag=1
		
	}
	q ConPatList
}

Storage Default
{
<Data name="NotificationDefaultData">
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
</Data>
<DataLocation>^Nur.MNISV3.Ser6AD.NotificationD</DataLocation>
<DefaultData>NotificationDefaultData</DefaultData>
<IdLocation>^Nur.MNISV3.Ser6AD.NotificationD</IdLocation>
<IndexLocation>^Nur.MNISV3.Ser6AD.NotificationI</IndexLocation>
<StreamLocation>^Nur.MNISV3.Ser6AD.NotificationS</StreamLocation>
<Type>%Storage.Persistent</Type>
}

}
